﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Lab1
{
    /// <summary>
    /// Interaction logic for Menu.xaml
    /// </summary>
    public partial class Menu : Page
    {
        public Menu()
        {
            InitializeComponent();
        }

        private void BeginTest(object sender, RoutedEventArgs e)
        {
            UserAnswerService.UserAnswers = new Dictionary<int, UserAnswer>();
            QuestionService qService = new QuestionService();
            Question question = qService.getRoot();
            Application.Current.Properties["questionId"] = question.Id;
            if (question.Type.Equals("Free"))
            {
               
                this.NavigationService.Navigate(new QuestionFree());
            }
            else
            {
                this.NavigationService.Navigate(new QuestionVariant());
            }
        }

        private void EditDataBase(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new Admin());
        }
    }
}
